package com.dss.auto_deploy.rabbitmq.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

/**
 * @Description:
 * @ClassName: ReturnCallBackHandler
 * @author: dongshoushan
 * @date: 2020年05月26日 16:16
 */
@Service
@Slf4j
public class ReturnCallBackHandler implements RabbitTemplate.ReturnCallback {
    @Override
    public void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey) {
        String msg = new String(message.getBody());
        log.warn("A-RETURN机制:消息路由失败,msg:{},replyCode:{},replyText:{},exchange:{},routingKey:{}", msg, replyCode, replyText, exchange, routingKey);
    }
}
